home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
bbsutil
/
bsrc_250.zip
/
B_INITVA.C
< prev
next >
Wrap
Text File
|
1991-09-15
|
15KB
|
444 lines
/*--------------------------------------------------------------------------*/
/* */
/* */
/* ------------ Bit-Bucket Software, Co. */
/* \ 10001101 / Writers and Distributors of */
/* \ 011110 / Freely Available<tm> Software. */
/* \ 1011 / */
/* ------ */
/* */
/* (C) Copyright 1987-91, Bit Bucket Software Co., a Delaware Corporation. */
/* */
/* */
/* This module was originally written by Vince Perriello */
/* */
/* */
/* BinkleyTerm Variable Initialization */
/* */
/* */
/* For complete details of the licensing restrictions, please refer */
/* to the License agreement, which is published in its entirety in */
/* the MAKEFILE and BT.C, and also contained in the file LICENSE.250. */
/* */
/* USE OF THIS FILE IS SUBJECT TO THE RESTRICTIONS CONTAINED IN THE */
/* BINKLEYTERM LICENSING AGREEMENT. IF YOU DO NOT FIND THE TEXT OF */
/* THIS AGREEMENT IN ANY OF THE AFOREMENTIONED FILES, OR IF YOU DO */
/* NOT HAVE THESE FILES, YOU SHOULD IMMEDIATELY CONTACT BIT BUCKET */
/* SOFTWARE CO. AT ONE OF THE ADDRESSES LISTED BELOW. IN NO EVENT */
/* SHOULD YOU PROCEED TO USE THIS FILE WITHOUT HAVING ACCEPTED THE */
/* TERMS OF THE BINKLEYTERM LICENSING AGREEMENT, OR SUCH OTHER */
/* AGREEMENT AS YOU ARE ABLE TO REACH WITH BIT BUCKET SOFTWARE, CO. */
/* */
/* */
/* You can contact Bit Bucket Software Co. at any one of the following */
/* addresses: */
/* */
/* Bit Bucket Software Co. FidoNet 1:104/501, 1:343/491 */
/* P.O. Box 460398 AlterNet 7:491/0 */
/* Aurora, CO 80046 BBS-Net 86:2030/1 */
/* Internet f491.n343.z1.fidonet.org */
/* */
/* Please feel free to contact us at any time to share your comments about */
/* our software and/or licensing policies. */
/* */
/*--------------------------------------------------------------------------*/
/* Include this file before any other includes or defines! */
#include "includes.h"
void compile_externs (void);
void fillin_defaults (struct secure *, struct secure *);
/**
** b_initvars -- called before parse_config. Sets defaults that we want
** to have set FIRST.
**/
void b_initvars ()
{
int k;
char *envp;
BINK_EVENT far *p;
BINK_EVENT foo;
if ((envp = getenv ("TZ")) != NULL)
{
if ((saved_TZ = calloc( 1, 4 + strlen (envp))) != NULL)
{
(void) strcpy (saved_TZ, "TZ=");
(void) strcat (saved_TZ, envp);
}
}
(void) putenv ("TZ=GMT0");
tzset ();
p = (BINK_EVENT far *) _fmalloc( 256 * sizeof (BINK_EVENT));
if (p == (BINK_EVENT far *) NULLGLOBALPTR)
{
(void) printf (MSG_TXT(M_BAD_EVENT_ALLOC));
exit (252);
}
(void) memset ((char *)&foo, 0 , sizeof (foo));
e_ptrs = p;
for (k = 0; k < 256; k++)
{
*p++ = foo;
}
(void) memset ((char *)&DEFAULT, 0 , sizeof (DEFAULT));
KNOWN = DEFAULT; /* Does some of the work */
KNOWN.rq_Limit = -1;
KNOWN.byte_Limit = -1L;
KNOWN.time_Limit = -1;
KNOWN.rq_Cum_Limit = -1;
KNOWN.byte_Cum_Limit = -1L;
KNOWN.time_Cum_Limit = -1L;
PROT = KNOWN; /* Initially the same default */
for (k = 0; k < 10; k++) /* Zero the phone scan list */
{
scan_list[k] = NULL;
}
for (k = 0; k < MAX_EXTERN; k++) /* And the external protocols */
{
protocols[k] = NULL;
}
for (k = 1; k < ALIAS_CNT; k++) /* And the alias list */
{
alias[k].Zone = alias[k].Net = alias[k].Node = alias[k].Point = 0;
alias[k].Domain = NULL;
}
alias[0].Zone = 1; /* Make sure we have a zone */
alias[0].Net = alias[0].Node = (unsigned) -1; /* Default Fidonet address */
alias[0].Point = 0;
alias[0].Domain = NULL;
#ifdef Snoop
pipename[0] = '\0'; /* Make sure we have no name */
if (getenv("SNOOPPIPE") != NULL)
{
strcpy (pipename, getenv("SNOOPPIPE"));
snoop_open(pipename);
}
#endif
b_init ();
baud = 2;
cur_baud = btypes[baud];
command_line_un = 0;
(void) memset (&dta_str, 0, sizeof (dta_str));
}
/**
** b_defaultvars -- called after all parse_config passes complete.
** sets anything not handled by parse_config to default if we know it.
**/
void b_defaultvars ()
{
int i;
char *p;
if (!fullscreen)
do_screen_blank = 0;
if (version7)
nodelist_name = "NODEX";
else
nodelist_name = "NODELIST";
if (modem_init == NULL)
modem_init = ctl_string ("|AT|");
if (modem_busy == NULL)
modem_busy = ctl_string ("|AT|");
if (net_info == NULL)
net_info = ctl_string (".\\");
/* Set up "boss" and "point" addresses correctly if we can */
if (boss_addr.Zone == 0)
boss_addr.Zone = alias[0].Zone;
if (boss_addr.Net == 0)
{
boss_addr = alias[0];
boss_addr.Point = 0;
}
if ((pvtnet >= 0) && (alias[0].Point != 0))
{
my_addr = boss_addr;
my_addr.Point = alias[0].Point;
alias[0].Net = (unsigned) pvtnet;
alias[0].Node = alias[0].Point;
alias[0].Point = 0;
}
else
my_addr = alias[0];
/* If we have the minimum information to do netmail, set the flag */
if ((alias[0].Zone != 0)
&& (alias[0].Net != 0)
&& (system_name != NULL)
&& (sysop != NULL)
&& (hold_area != NULL)
&& (DEFAULT.sc_Inbound != NULL))
{
net_params = 1;
(void) flag_file (INITIALIZE, &alias[0], 0);
}
if (system_name == NULL)
system_name = "";
if (hold_area == NULL)
hold_area = ctl_string (".\\");
if (DEFAULT.sc_Inbound == NULL)
DEFAULT.sc_Inbound = ctl_string (".\\");
/* Make the "higher class" requests at least as well off as the
"lowest class"... */
fillin_defaults (&KNOWN, &DEFAULT);
fillin_defaults (&PROT, &KNOWN);
if (extern_index)
compile_externs (); /* generate extern_protocols */
if (!colors.calling && colors.hold)
colors